package edu.upenn.seas.peerreview.smui

import scala.collection.mutable
import edu.upenn.seas.peerreview.{Id, Sink}

class RPCBSNameServer(myId:Id, t:Sink.T) extends RPCAgent[NameServerInterface](myId, t) {
  protected val registered : mutable.Map[String, Id] = mutable.Map()

  def main {

   forkhandler('put) {
     case (key: String) :: (value: Id) :: Nil => registered(key) = value
     case _ => // Compiler warnings.
   }
    forkhandler('get) {
      case (key: String) :: Nil => registered.get(key)
      case _ => // Compiler warnings.
    }
  }

}

